<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
    Document   : index
    Created on : March 5th 2014
    Author     :Ihab Ali
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./WEB-INF/templates/template.xhtml">

            <ui:define name="content">
               
                 <h:form id="searchBar">
                     <p:growl  id ="growl" showDetail="true" sticky="true" /> 

                <p:layout id="mainContent" style="height: 514px; font-size: x-small">
                    <p:layoutUnit id="northLay" position="north" >
                        
                            
                            <p:selectOneMenu   id ="textBar" 
                                               value="#{bean.browserModel.searchItem}"
                                               editable="true"
                                               style="width: 350px; float: left " 
                                               >
                                <p:ajax update="textBar" event="change"></p:ajax>
                                
                                <f:selectItems id="list"  value="#{bean.browserModel.searchHistory}"
                                          /> 
                           </p:selectOneMenu>
                            
                       
                             
                         <p:commandButton id="resetButton"
                                          value="Browse"  
                                          style="font-size: x-small;float: left; height: 30px"
                                          update="searchBar,textBar"
                                          process="@this"
                                          type="submit"
                                          action="#{bean.pageSubmitted()}"
                                         />
                         </p:layoutUnit>


                    <p:layoutUnit id="layoutPKG" position="center" style="padding: 0; border-collapse:collapse ; margin: 0;"  >
                        <h:panelGrid id="layoutPKG1"  columns="4" style="padding: 0; margin: 0 ; border-collapse: collapse" > 

                            <p:layout id="layoutPKG2" style="width: 320px ;height: 390px ;font-size: x-small">
                                <p:layoutUnit id="layoutPKG3" header="Packages" position="center" style="padding: 0 ;margin: 0 ;border: none ">
                                
                                   
                                        <h:selectOneListbox  id="packgs"
                                                             
                                                             style="height: 345px ;width: 300px;"
                                                             value="#{bean.browserModel.packageToSearch}"
                                                             valueChangeListener="#{bean.dontChangeIt(vce)}"
                                                             > 
                                            <p:ajax event="change" process="@this" update="searchBar"/>

                                            <f:selectItems actionListener="#{bean.dontChangeIt(vce)}" value="#{bean.browserModel.sorted_map}" /> 
                                        </h:selectOneListbox> 


                                    
                                </p:layoutUnit>
                                
                                <p:layoutUnit position="south" style="padding: 0 ;margin: 0 ;border: none ">
                                    <h:outputText value="Packeges #{bean.browserModel.numberOfPackages}" ></h:outputText>
                                </p:layoutUnit>
                             
                            </p:layout>
                            
                            

                            <p:layout id="classes" style="width: 233px ;height: 390px ;font-size: x-small">

                                <p:layoutUnit position="center" style="height: 430px"  header="Class Hierarachy" >
                                    <p:panel>
                                    <p:tree id="ClassTree"  
                                            selection="#{bean.browserModel.selectedNode}" 
                                            value="#{bean.browserModel.root}"
                                            var="node"
                                            
                                           
                                            selectionMode="single"
                                            style="width: 233px ;height: 400px;"
                                            >
                                       
                                    
                                        <p:treeNode  >
                                            
                                            <h:outputText value="#{node}" />
                                            
                                                
                                        </p:treeNode>
                                     
                                    
                                    </p:tree>
                                            
                                       </p:panel>
                                   
                                </p:layoutUnit>

                                <p:layoutUnit position="south" style="padding: 0 ;margin: 0 ;border: none ">
                                    <h:outputText value="Classes #{bean.browserModel.numberOfClass}" ></h:outputText>
                                </p:layoutUnit>
                            </p:layout>



                            <p:layout id="modifiers" style="width: 233px ;height: 390px">

                                <p:layoutUnit position="center">
                                    <p:scrollPanel >
                                        <p:panel header="Filters" style="font-size: x-small">
                                           
                                        <p:outputPanel id="customPanel">  
                                            
                                            <p:selectOneRadio id="customRadio" layout="custom" value="#{bean.browserModel.radioOption}">  
                                                <f:selectItem itemLabel="Option 1" itemValue="0" />  
                                                <f:selectItem itemLabel="Option 2" itemValue="1" />  
                                                <f:selectItem itemLabel="Option 3" itemValue="2" />  
                                                <f:selectItem itemLabel="Option 4" itemValue="3" /> 
                                                
                                                 <p:ajax event="change" listener="#{bean.radioButtonClicked()}" update="members" process="@this" />
                                            </p:selectOneRadio>
                                            <h:panelGrid columns="2" >  
                                            <p:radioButton id="opt1" for="customRadio"  itemIndex="0" />  
                                            <h:outputLabel for="opt1" value="All"  />  
                                            <p:radioButton id="opt2" for="customRadio" itemIndex="1"/>  
                                            <h:outputLabel for="opt2" value="Fields" />  
                                             <p:radioButton id="opt3" for="customRadio" itemIndex="2"/>  
                                            <h:outputLabel for="opt3" value="Constructors" />  
                                            <p:radioButton id="opt4" for="customRadio" itemIndex="3"/>  
                                            <h:outputLabel for="opt4" value="Methods" />  
                                            
                                        </h:panelGrid>  
                                        </p:outputPanel>  
                                       </p:panel>
                                        <p:panel header="Instance or Static" style="font-size: x-small">
                                            <h:panelGrid columns="4"  >
                                             <p:outputLabel value="instance" />
                                             <h:selectBooleanCheckbox  id="instance" value="#{bean.browserModel.instance}" >
                                                 <p:ajax  event="change" listener="#{bean.handlePublic()}" update="searchBar,members,memebersTodisplay,membersList" process="@this"   />
                                             </h:selectBooleanCheckbox> 
                                            <p:outputLabel value="static" />
                                            <h:selectBooleanCheckbox  id="static" value="#{bean.browserModel.staticButton}">
                                                <p:ajax event="select" listener="#{bean.handlePublic()}" update="@this" process="@this" />
                                            </h:selectBooleanCheckbox>
                                                
                                            
                                            </h:panelGrid>
                                        </p:panel>
                                        
                                        <p:panel header="Access Modifiers" style="font-size: x-small">
                                            <h:panelGrid columns="4"  >
                                                <p:outputLabel value="default" />
                                                <h:selectBooleanCheckbox  id="default" value="#{bean.browserModel.defaultButton}" >
                                                    <p:ajax event="change" listener="#{bean.handlePublic()}" update="searchBar"  process="@this" />
                                                </h:selectBooleanCheckbox>
                                                 <p:outputLabel value="protected" />
                                                 <h:selectBooleanCheckbox    id="protected" value="#{bean.browserModel.protectedButton}" >
                                                     <p:ajax event="change" listener="#{bean.handlePublic()}" update="members,memebersTodisplay" process="@this" />
                                                 </h:selectBooleanCheckbox>
                                                <p:outputLabel value="private" />
                                                <h:selectBooleanCheckbox  id="private" value="#{bean.browserModel.privateButton}" >
                                                    <p:ajax event="change" listener="#{bean.handlePublic()}" update="members,memebersTodisplay" process="@this" />
                                                </h:selectBooleanCheckbox>                                                
                                                <p:outputLabel value="public" />
                                                <h:selectBooleanCheckbox id="public"  value="#{bean.browserModel.publicButton}" >
                                                    <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                </h:selectBooleanCheckbox>
                                               
                                            </h:panelGrid>
                                         </p:panel>
                                        <p:panel header="Other Modifiers" style="font-size: x-small">
                                            <p:panelGrid columns="4" >
                                                
                                                <p:outputLabel value="abstract" />
                                                <h:selectBooleanCheckbox   id="abstract"  value="#{bean.browserModel.abstrButton}"  >
                                                    <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                </h:selectBooleanCheckbox> 
                                                 
                                                 <p:outputLabel value="synchronized"/> >
                                                     <h:selectBooleanCheckbox id="sync"  value="#{bean.browserModel.syncButton}" >
                                                         <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                     </h:selectBooleanCheckbox> 
                                                 
                                                 <p:outputLabel value="final" />
                                                 <h:selectBooleanCheckbox  id="final"  value="#{bean.browserModel.finalButton}" >
                                                     <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                 </h:selectBooleanCheckbox>
                                                  
                                                 <p:outputLabel value="throws" />
                                                 <h:selectBooleanCheckbox  id="throws" value="#{bean.browserModel.throwsButton}" >
                                                     <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                 </h:selectBooleanCheckbox>
                                                  
                                                  <p:outputLabel value="native" />
                                                  <h:selectBooleanCheckbox   id="native"  value="#{bean.browserModel.nativeButton}" >
                                                      <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                  </h:selectBooleanCheckbox> 
                                                 
                                                 <p:outputLabel value="transient" />
                                                 <h:selectBooleanCheckbox   id="trans" value="#{bean.browserModel.transiButton}" >
                                                     <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                 </h:selectBooleanCheckbox>
                                                  
                                                  <p:outputLabel value="strict" />
                                                      <h:selectBooleanCheckbox   id="strict"   value="#{bean.browserModel.stricButton}" >
                                                          <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                      </h:selectBooleanCheckbox> 
                                                 
                                                 <p:outputLabel value="volatile" />
                                                 <h:selectBooleanCheckbox  id="volatile"  value="#{bean.browserModel.volatileButton}" >
                                                     <p:ajax event="change" listener="#{bean.handlePublic()}" update="members" process="@this" />
                                                 </h:selectBooleanCheckbox>
                                               
                                            </p:panelGrid>
                                        </p:panel>
                                        
                                    </p:scrollPanel>
                                </p:layoutUnit>
                                
                            </p:layout>


                            <p:layout id="members" style="width: 330px;height: 400px">
                                <p:layoutUnit position="center">
                                   <p:panel header="Members" style="font-size: x-small; height:370px; ">
                                       <p:panelGrid id="membersList" columns="1">
                                       
                                           <p:selectOneListbox id="memebersTodisplay" 
                                                               style="height: 340px ;width: 290px;"
                                                               value="#{bean.browserModel.memeberSelected}"
                                                               >
                                               <f:selectItems value= "#{bean.browserModel.fieldsKeysAndValues}">
                                                   
                                               </f:selectItems>
                                                   
                                              
                                               <f:selectItem itemLabel="&nbsp;"   itemValue="1" itemEscaped="false" /> 
                                               
                                               <f:selectItems value= "#{bean.browserModel.constructorsKeysAnsValues}">
                                               </f:selectItems>
                                                  
                                               <f:selectItem itemLabel="&nbsp;"  itemEscaped="false" itemValue="1" >
                                                                 
                                               </f:selectItem>
                                               
                                               <f:selectItems value= "#{bean.browserModel.methodsKeysAndValues}"/>
                                               <p:ajax event="change" listener="#{bean.memberSelected()}" update="declaration,,searchBar" process="@this" />
                                               
                                           </p:selectOneListbox>
                                      </p:panelGrid>
                                     
                                   </p:panel>
                                </p:layoutUnit>
                                <p:layoutUnit position="south" style="padding: 0 ;margin: 0 ;border: none ">
                                    <h:outputText id="membersCount" value="Members #{bean.browserModel.membersCount}" ></h:outputText>
                                </p:layoutUnit>
                            </p:layout>

                        </h:panelGrid>

                    </p:layoutUnit>



                    <p:layoutUnit position="south">
                        <p:panel style="width: 99% ;height: 40px ; font-size: x-small" header="Declaration">
                            
                                <h:outputText id="declaration" value="#{bean.browserModel.declaration}" ></h:outputText>
                           
                        </p:panel>
                    </p:layoutUnit>
                </p:layout>
           </h:form>
        
     </ui:define>
  </ui:composition>
 </body>
</html>
